package com.gongyibao.gbase.service.impl;

import com.gongyibao.gbase.entity.TUser;
import com.gongyibao.gbase.mapper.TUserMapper;
import com.gongyibao.gbase.service.TUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class TUserServiceImpl implements TUserService {

    @Autowired
    private TUserMapper tUserMapper;

    @Override
    public TUser getUserById(Integer id) {
        return tUserMapper.selectByPrimaryKey(id);
    }

    @Override
    public Boolean insertUser(TUser user) {
        return tUserMapper.insert(user) > 0;
    }

    @Override
    public Boolean updateUser(TUser user) {
        return tUserMapper.updateByPrimaryKeySelective(user) > 0;
    }

    @Override
    public Boolean delUser(Integer id) {
        return tUserMapper.deleteByPrimaryKey(id) > 0;
    }

}